3.7.92 \(\int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx\) [692]

3.7.92.1 Optimal result
3.7.92.2 Mathematica [A] (verified)
3.7.92.3 Rubi [A] (verified)
3.7.92.4 Maple [A] (verified)
3.7.92.5 Fricas [A] (verification not implemented)
3.7.92.6 Sympy [B] (verification not implemented)
3.7.92.7 Maxima [A] (verification not implemented)
3.7.92.8 Giac [A] (verification not implemented)
3.7.92.9 Mupad [B] (verification not implemented)

3.7.92.1 Optimal result

Integrand size = 41, antiderivative size = 132 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx=\frac {a^3 (i A+B) c^4 (1-i \tan (e+f x))^4}{f}-\frac {4 a^3 (i A+2 B) c^4 (1-i \tan (e+f x))^5}{5 f}+\frac {a^3 (i A+5 B) c^4 (1-i \tan (e+f x))^6}{6 f}-\frac {a^3 B c^4 (1-i \tan (e+f x))^7}{7 f} \]

output
a^3*(I*A+B)*c^4*(1-I*tan(f*x+e))^4/f-4/5*a^3*(I*A+2*B)*c^4*(1-I*tan(f*x+e) 
)^5/f+1/6*a^3*(I*A+5*B)*c^4*(1-I*tan(f*x+e))^6/f-1/7*a^3*B*c^4*(1-I*tan(f* 
x+e))^7/f
 
3.7.92.2 Mathematica [A] (verified)

Time = 2.09 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.99 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx=\frac {a^3 c^4 \left (7 i A+29 B+210 A \tan (e+f x)+105 (-i A+B) \tan ^2(e+f x)+70 (2 A-i B) \tan ^3(e+f x)+105 (-i A+B) \tan ^4(e+f x)+42 (A-2 i B) \tan ^5(e+f x)+35 (-i A+B) \tan ^6(e+f x)-30 i B \tan ^7(e+f x)\right )}{210 f} \]

input
Integrate[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f 
*x])^4,x]
 
output
(a^3*c^4*((7*I)*A + 29*B + 210*A*Tan[e + f*x] + 105*((-I)*A + B)*Tan[e + f 
*x]^2 + 70*(2*A - I*B)*Tan[e + f*x]^3 + 105*((-I)*A + B)*Tan[e + f*x]^4 + 
42*(A - (2*I)*B)*Tan[e + f*x]^5 + 35*((-I)*A + B)*Tan[e + f*x]^6 - (30*I)* 
B*Tan[e + f*x]^7))/(210*f)
 
3.7.92.3 Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.80, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3042, 4071, 27, 86, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^4 (A+B \tan (e+f x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^4 (A+B \tan (e+f x))dx\)

\(\Big \downarrow \) 4071

\(\displaystyle \frac {a c \int a^2 c^3 (1-i \tan (e+f x))^3 (i \tan (e+f x)+1)^2 (A+B \tan (e+f x))d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {a^3 c^4 \int (1-i \tan (e+f x))^3 (i \tan (e+f x)+1)^2 (A+B \tan (e+f x))d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 86

\(\displaystyle \frac {a^3 c^4 \int \left (i B (1-i \tan (e+f x))^6+(A-5 i B) (1-i \tan (e+f x))^5-4 (A-2 i B) (1-i \tan (e+f x))^4+4 (A-i B) (1-i \tan (e+f x))^3\right )d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^3 c^4 \left (\frac {1}{6} (5 B+i A) (1-i \tan (e+f x))^6-\frac {4}{5} (2 B+i A) (1-i \tan (e+f x))^5+(B+i A) (1-i \tan (e+f x))^4-\frac {1}{7} B (1-i \tan (e+f x))^7\right )}{f}\)

input
Int[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^4 
,x]
 
output
(a^3*c^4*((I*A + B)*(1 - I*Tan[e + f*x])^4 - (4*(I*A + 2*B)*(1 - I*Tan[e + 
 f*x])^5)/5 + ((I*A + 5*B)*(1 - I*Tan[e + f*x])^6)/6 - (B*(1 - I*Tan[e + f 
*x])^7)/7))/f
 

3.7.92.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 86
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ 
.), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; 
 FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 
] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p 
+ 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4071
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + 
 (f_.)*(x_)])*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si 
mp[a*(c/f)   Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x], x 
, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c 
+ a*d, 0] && EqQ[a^2 + b^2, 0]
 
3.7.92.4 Maple [A] (verified)

Time = 0.35 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.82

method result size
risch \(\frac {16 c^{4} a^{3} \left (105 i A \,{\mathrm e}^{6 i \left (f x +e \right )}+105 B \,{\mathrm e}^{6 i \left (f x +e \right )}+147 i A \,{\mathrm e}^{4 i \left (f x +e \right )}-21 B \,{\mathrm e}^{4 i \left (f x +e \right )}+49 i A \,{\mathrm e}^{2 i \left (f x +e \right )}-7 B \,{\mathrm e}^{2 i \left (f x +e \right )}+7 i A -B \right )}{105 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{7}}\) \(108\)
derivativedivides \(-\frac {i c^{4} a^{3} \left (\frac {B \tan \left (f x +e \right )^{7}}{7}+\frac {\left (i B +A \right ) \tan \left (f x +e \right )^{6}}{6}+\frac {\left (-4 B -2 i A +3 i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{5}}{5}+\frac {\left (-4 A +3 i \left (-2 i A -B \right )+5 i B \right ) \tan \left (f x +e \right )^{4}}{4}+\frac {\left (3 i A +3 B -i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{3}}{3}+\frac {\left (3 A -i \left (-2 i A -B \right )\right ) \tan \left (f x +e \right )^{2}}{2}+i \tan \left (f x +e \right ) A \right )}{f}\) \(159\)
default \(-\frac {i c^{4} a^{3} \left (\frac {B \tan \left (f x +e \right )^{7}}{7}+\frac {\left (i B +A \right ) \tan \left (f x +e \right )^{6}}{6}+\frac {\left (-4 B -2 i A +3 i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{5}}{5}+\frac {\left (-4 A +3 i \left (-2 i A -B \right )+5 i B \right ) \tan \left (f x +e \right )^{4}}{4}+\frac {\left (3 i A +3 B -i \left (-2 i B +A \right )\right ) \tan \left (f x +e \right )^{3}}{3}+\frac {\left (3 A -i \left (-2 i A -B \right )\right ) \tan \left (f x +e \right )^{2}}{2}+i \tan \left (f x +e \right ) A \right )}{f}\) \(159\)
norman \(\frac {A \,a^{3} c^{4} \tan \left (f x +e \right )}{f}+\frac {\left (-i A \,a^{3} c^{4}+B \,a^{3} c^{4}\right ) \tan \left (f x +e \right )^{2}}{2 f}+\frac {\left (-i A \,a^{3} c^{4}+B \,a^{3} c^{4}\right ) \tan \left (f x +e \right )^{4}}{2 f}+\frac {\left (-i A \,a^{3} c^{4}+B \,a^{3} c^{4}\right ) \tan \left (f x +e \right )^{6}}{6 f}+\frac {\left (-2 i B \,a^{3} c^{4}+A \,a^{3} c^{4}\right ) \tan \left (f x +e \right )^{5}}{5 f}+\frac {\left (-i B \,a^{3} c^{4}+2 A \,a^{3} c^{4}\right ) \tan \left (f x +e \right )^{3}}{3 f}-\frac {i B \,a^{3} c^{4} \tan \left (f x +e \right )^{7}}{7 f}\) \(201\)
parallelrisch \(-\frac {30 i B \,a^{3} c^{4} \tan \left (f x +e \right )^{7}+35 i A \tan \left (f x +e \right )^{6} a^{3} c^{4}+84 i B \tan \left (f x +e \right )^{5} a^{3} c^{4}-35 B \tan \left (f x +e \right )^{6} a^{3} c^{4}+105 i A \tan \left (f x +e \right )^{4} a^{3} c^{4}-42 A \tan \left (f x +e \right )^{5} a^{3} c^{4}+70 i B \tan \left (f x +e \right )^{3} a^{3} c^{4}-105 B \tan \left (f x +e \right )^{4} a^{3} c^{4}+105 i A \tan \left (f x +e \right )^{2} a^{3} c^{4}-140 A \tan \left (f x +e \right )^{3} a^{3} c^{4}-105 B \tan \left (f x +e \right )^{2} a^{3} c^{4}-210 A \tan \left (f x +e \right ) a^{3} c^{4}}{210 f}\) \(215\)
parts \(\frac {\left (-3 i A \,a^{3} c^{4}+3 B \,a^{3} c^{4}\right ) \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {\left (-3 i A \,a^{3} c^{4}+3 B \,a^{3} c^{4}\right ) \left (\frac {\tan \left (f x +e \right )^{4}}{4}-\frac {\tan \left (f x +e \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {\left (-3 i B \,a^{3} c^{4}+A \,a^{3} c^{4}\right ) \left (\frac {\tan \left (f x +e \right )^{5}}{5}-\frac {\tan \left (f x +e \right )^{3}}{3}+\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {\left (-3 i B \,a^{3} c^{4}+3 A \,a^{3} c^{4}\right ) \left (\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {\left (-i A \,a^{3} c^{4}+B \,a^{3} c^{4}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}+\frac {\left (-i A \,a^{3} c^{4}+B \,a^{3} c^{4}\right ) \left (\frac {\tan \left (f x +e \right )^{6}}{6}-\frac {\tan \left (f x +e \right )^{4}}{4}+\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {\left (-i B \,a^{3} c^{4}+3 A \,a^{3} c^{4}\right ) \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+A \,a^{3} c^{4} x -\frac {i B \,a^{3} c^{4} \left (\frac {\tan \left (f x +e \right )^{7}}{7}-\frac {\tan \left (f x +e \right )^{5}}{5}+\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) \(427\)

input
int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x,method=_R 
ETURNVERBOSE)
 
output
16/105*c^4*a^3*(105*I*A*exp(6*I*(f*x+e))+105*B*exp(6*I*(f*x+e))+147*I*A*ex 
p(4*I*(f*x+e))-21*B*exp(4*I*(f*x+e))+49*I*A*exp(2*I*(f*x+e))-7*B*exp(2*I*( 
f*x+e))+7*I*A-B)/f/(exp(2*I*(f*x+e))+1)^7
 
3.7.92.5 Fricas [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 170, normalized size of antiderivative = 1.29 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx=-\frac {16 \, {\left (105 \, {\left (-i \, A - B\right )} a^{3} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + 21 \, {\left (-7 i \, A + B\right )} a^{3} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, {\left (-7 i \, A + B\right )} a^{3} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-7 i \, A + B\right )} a^{3} c^{4}\right )}}{105 \, {\left (f e^{\left (14 i \, f x + 14 i \, e\right )} + 7 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 21 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 35 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 35 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 21 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

input
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x, al 
gorithm="fricas")
 
output
-16/105*(105*(-I*A - B)*a^3*c^4*e^(6*I*f*x + 6*I*e) + 21*(-7*I*A + B)*a^3* 
c^4*e^(4*I*f*x + 4*I*e) + 7*(-7*I*A + B)*a^3*c^4*e^(2*I*f*x + 2*I*e) + (-7 
*I*A + B)*a^3*c^4)/(f*e^(14*I*f*x + 14*I*e) + 7*f*e^(12*I*f*x + 12*I*e) + 
21*f*e^(10*I*f*x + 10*I*e) + 35*f*e^(8*I*f*x + 8*I*e) + 35*f*e^(6*I*f*x + 
6*I*e) + 21*f*e^(4*I*f*x + 4*I*e) + 7*f*e^(2*I*f*x + 2*I*e) + f)
 
3.7.92.6 Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 287 vs. \(2 (107) = 214\).

Time = 0.64 (sec) , antiderivative size = 287, normalized size of antiderivative = 2.17 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx=\frac {112 i A a^{3} c^{4} - 16 B a^{3} c^{4} + \left (784 i A a^{3} c^{4} e^{2 i e} - 112 B a^{3} c^{4} e^{2 i e}\right ) e^{2 i f x} + \left (2352 i A a^{3} c^{4} e^{4 i e} - 336 B a^{3} c^{4} e^{4 i e}\right ) e^{4 i f x} + \left (1680 i A a^{3} c^{4} e^{6 i e} + 1680 B a^{3} c^{4} e^{6 i e}\right ) e^{6 i f x}}{105 f e^{14 i e} e^{14 i f x} + 735 f e^{12 i e} e^{12 i f x} + 2205 f e^{10 i e} e^{10 i f x} + 3675 f e^{8 i e} e^{8 i f x} + 3675 f e^{6 i e} e^{6 i f x} + 2205 f e^{4 i e} e^{4 i f x} + 735 f e^{2 i e} e^{2 i f x} + 105 f} \]

input
integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**4,x)
 
output
(112*I*A*a**3*c**4 - 16*B*a**3*c**4 + (784*I*A*a**3*c**4*exp(2*I*e) - 112* 
B*a**3*c**4*exp(2*I*e))*exp(2*I*f*x) + (2352*I*A*a**3*c**4*exp(4*I*e) - 33 
6*B*a**3*c**4*exp(4*I*e))*exp(4*I*f*x) + (1680*I*A*a**3*c**4*exp(6*I*e) + 
1680*B*a**3*c**4*exp(6*I*e))*exp(6*I*f*x))/(105*f*exp(14*I*e)*exp(14*I*f*x 
) + 735*f*exp(12*I*e)*exp(12*I*f*x) + 2205*f*exp(10*I*e)*exp(10*I*f*x) + 3 
675*f*exp(8*I*e)*exp(8*I*f*x) + 3675*f*exp(6*I*e)*exp(6*I*f*x) + 2205*f*ex 
p(4*I*e)*exp(4*I*f*x) + 735*f*exp(2*I*e)*exp(2*I*f*x) + 105*f)
 
3.7.92.7 Maxima [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.14 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx=-\frac {30 i \, B a^{3} c^{4} \tan \left (f x + e\right )^{7} + 35 \, {\left (i \, A - B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{6} - 42 \, {\left (A - 2 i \, B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{5} + 105 \, {\left (i \, A - B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{4} - 70 \, {\left (2 \, A - i \, B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{3} + 105 \, {\left (i \, A - B\right )} a^{3} c^{4} \tan \left (f x + e\right )^{2} - 210 \, A a^{3} c^{4} \tan \left (f x + e\right )}{210 \, f} \]

input
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x, al 
gorithm="maxima")
 
output
-1/210*(30*I*B*a^3*c^4*tan(f*x + e)^7 + 35*(I*A - B)*a^3*c^4*tan(f*x + e)^ 
6 - 42*(A - 2*I*B)*a^3*c^4*tan(f*x + e)^5 + 105*(I*A - B)*a^3*c^4*tan(f*x 
+ e)^4 - 70*(2*A - I*B)*a^3*c^4*tan(f*x + e)^3 + 105*(I*A - B)*a^3*c^4*tan 
(f*x + e)^2 - 210*A*a^3*c^4*tan(f*x + e))/f
 
3.7.92.8 Giac [A] (verification not implemented)

Time = 0.96 (sec) , antiderivative size = 215, normalized size of antiderivative = 1.63 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx=-\frac {16 \, {\left (-105 i \, A a^{3} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} - 105 \, B a^{3} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} - 147 i \, A a^{3} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + 21 \, B a^{3} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} - 49 i \, A a^{3} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + 7 \, B a^{3} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} - 7 i \, A a^{3} c^{4} + B a^{3} c^{4}\right )}}{105 \, {\left (f e^{\left (14 i \, f x + 14 i \, e\right )} + 7 \, f e^{\left (12 i \, f x + 12 i \, e\right )} + 21 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 35 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 35 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 21 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 7 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

input
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^4,x, al 
gorithm="giac")
 
output
-16/105*(-105*I*A*a^3*c^4*e^(6*I*f*x + 6*I*e) - 105*B*a^3*c^4*e^(6*I*f*x + 
 6*I*e) - 147*I*A*a^3*c^4*e^(4*I*f*x + 4*I*e) + 21*B*a^3*c^4*e^(4*I*f*x + 
4*I*e) - 49*I*A*a^3*c^4*e^(2*I*f*x + 2*I*e) + 7*B*a^3*c^4*e^(2*I*f*x + 2*I 
*e) - 7*I*A*a^3*c^4 + B*a^3*c^4)/(f*e^(14*I*f*x + 14*I*e) + 7*f*e^(12*I*f* 
x + 12*I*e) + 21*f*e^(10*I*f*x + 10*I*e) + 35*f*e^(8*I*f*x + 8*I*e) + 35*f 
*e^(6*I*f*x + 6*I*e) + 21*f*e^(4*I*f*x + 4*I*e) + 7*f*e^(2*I*f*x + 2*I*e) 
+ f)
 
3.7.92.9 Mupad [B] (verification not implemented)

Time = 8.48 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.18 \[ \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx=-\frac {\frac {a^3\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (2\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{5}-A\,a^3\,c^4\,\mathrm {tan}\left (e+f\,x\right )+\frac {a^3\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (A+B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {a^3\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (B+A\,2{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}+\frac {a^3\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (A+B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {a^3\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^6\,\left (A+B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{6}+\frac {B\,a^3\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^7\,1{}\mathrm {i}}{7}}{f} \]

input
int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3*(c - c*tan(e + f*x)*1i) 
^4,x)
 
output
-((a^3*c^4*tan(e + f*x)^5*(A*1i + 2*B)*1i)/5 - A*a^3*c^4*tan(e + f*x) + (a 
^3*c^4*tan(e + f*x)^2*(A + B*1i)*1i)/2 + (a^3*c^4*tan(e + f*x)^3*(A*2i + B 
)*1i)/3 + (a^3*c^4*tan(e + f*x)^4*(A + B*1i)*1i)/2 + (a^3*c^4*tan(e + f*x) 
^6*(A + B*1i)*1i)/6 + (B*a^3*c^4*tan(e + f*x)^7*1i)/7)/f